HTML Basics

Before you start writing pages, you'll need to know a few basic HTML concepts. HTML documents are made up of text, media content such as graphics, audio, and video, and HTML tags that determine how a Web browser displays the content.

Tags and content

HTML tags are enclosed in brackets made of the less-than and greater-than signs on your keyboard, (< >). Most HTML tags consist of a start tag, <TAG NAME>, and an end tag, </TAG NAME>. The end tag is identified by a forward slash (/) before the tag name. Some tags, such as the Break <BR> and Horizontal Rule <HR> tags, do not require an end tag.

Tag attributes and their values are entered in the start tag, <TAG NAME ATTRIBUTE="value">. Attributes are separated from one another by a single space. There should be no spaces after the left bracket (<) or before the right bracket (>).

Tag and attribute names are not case-sensitive, so that <HTML> and <html> are interchangeable. Some attributes values, particularly file names, are case-sensitive, however.

Many tags can be nested, that is, placed inside other tags, but tags should never overlap:

Correct: <P><FONT SIZE="2">text</FONT></P>

Incorrect: <P><FONT SIZE="2">text</P></FONT>

The actual page content, text, links, images, etc., is placed between the start and end tags.

An HTML sample

Here's a brief HTML sample. Notice that the only text that will actually display in a browser is My Home Page. The rest of this sample block will be invisible in the browser because it is enclosed in tag brackets.

<P ALIGN="Center">
<FONT SIZE="+3">My Home Page</FONT>
</P>

In this sample block, the <P> and <FONT> tags contain attributes with values for the appearance of the text. The attribute ALIGN="Center" tells the browser to center the text on the page.

Requirements of an HTML document

When you open a new document in HomeSite, the default template inserts the elements required for a valid HTML document.

The default document template contains these elements:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    
    <HTML>
    <HEAD>
    <TITLE>Untitled</TITLE>
    </HEAD>
    
    <BODY>
    
    
    </BODY>
    </HTML>

These tags must be included in every Web page. The following table provides a brief description of each of these required elements.

Tag Description

DOCTYPE

Declares the version of HTML that you are using.

HTML

Marks the beginning and end of the HTML code.

HEAD

Contains data about the document, including the title, metadata, scripts, and a style block or style sheet link.

TITLE

Contains the title of the document, which is displayed in the title bar of the browser and is important for indexing documents.

BODY

Contains everything that will be rendered by the browser.